/**
 * 
 */
package com.antilia.infomaresme.pages.home;

import org.apache.wicket.Component;
import org.apache.wicket.model.ResourceModel;

import com.antilia.infomaresme.DataInitialiser;
import com.antilia.infomaresme.data.dao.interfaces.ICategoriesDao;
import com.antilia.infomaresme.data.dao.interfaces.IItemsDao;
import com.antilia.infomaresme.data.dao.interfaces.IUsersDao;
import com.antilia.infomaresme.pages.BasePage;
import com.antilia.infomaresme.pages.ChooseCategoryPanel;
import com.antilia.infomaresme.pages.LogedAsPanel;
import com.google.inject.Inject;


/**
 * @author Ernesto
 *
 */
public class PrivateSearchPage extends BasePage {

	private static final long serialVersionUID = 1L;

	@Inject
	private IItemsDao dao;
	
	@Inject
	private ICategoriesDao categoriesDao;
	
	@Inject
	private IUsersDao usersDao;
	
	
	/**
	 * 
	 */
	public PrivateSearchPage() {
		if(categoriesDao.findTopLevel().size()==0)
			new DataInitialiser(dao, categoriesDao, usersDao);
		ChooseCategoryPanel categories = new ChooseCategoryPanel("categories");
		add(categories);
	}
	
	@Override
	protected Component newRightPanel(String id) {
		return new LogedAsPanel(id);
	}
	
	@Override
	protected Component newTopMavigation(String id) {
		return new TitlePanel(id, new ResourceModel("navigation.searchAnnouncement"));
	}

	public IItemsDao getDao() {
		return dao;
	}

	public void setDao(IItemsDao dao) {
		this.dao = dao;
	}

	public ICategoriesDao getCategoriesDao() {
		return categoriesDao;
	}

	public void setCategoriesDao(ICategoriesDao categoriesDao) {
		this.categoriesDao = categoriesDao;
	}

	public IUsersDao getUsersDao() {
		return usersDao;
	}

	public void setUsersDao(IUsersDao usersDao) {
		this.usersDao = usersDao;
	}
}
